package com.mikeli.learn.student.configuration;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;


@ConfigurationProperties(prefix = "mikeli.learn.student")
@Configuration
@Data
public class StudentPropertiesConfiguration {
    String name="默认王五";
    String age="18";

    @Bean
    public Student student(){
        Student student = new Student();
        student.setAge(age);
        student.setName(name);
        return student;
    }
}
